<?php 
/**
 * 
 */
class Silk_Mapi_Adminhtml_CustomerfeedbackController extends Mage_Adminhtml_Controller_Action
{
	
	public function indexAction()
    {
        $this->_titles = array("轻松老板", 'APP版本管理');
        $this->loadLayout();
        $this->_setActiveMenu('customer');
        $this->_addContent($this->getLayout()->createBlock('mapi/adminhtml_customerfeedback'));
        $this->renderLayout();
    }

    public function viewAction()
    {
    	$feedId = $this->getRequest()->getParam("id");
    	if(!$feedId)
    	{
    		Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("缺少参数ID"));
    		return $this->_redirect("*/*/index");
    	}

    	$collection = Mage::getModel("mapi/feedback")->load($feedId);
    	if($collection->getViewCount())
    	{
    		$lastCount = $collection->getViewCount() + 1;
    		$collection->setViewCount($lastCount)->save();
    	}else{
    		$collection->setViewCount(1)->save();
    	}
    	$this->loadLayout();
        $this->renderLayout();
    }
}